﻿using UnityEngine;
using System.Collections;

namespace Battle
{
    public class SkipUltiBtn : MonoBehaviour
    {
        public UISprite btnSprite;

        public string enable_sprite_name;
        public string disable_sprite_name;

        public void Refresh()
        {
            SwitchSkipUltiState(StaticData.isAutoSkipUltimate);
        }

        void SwitchSkipUltiState(bool isSkip)
        {
            if (isSkip)
            {
                btnSprite.spriteName = enable_sprite_name;
            }
            else
            {
                btnSprite.spriteName = disable_sprite_name;
            }
        }

        void OnClick()
        {
            StaticData.isAutoSkipUltimate = !StaticData.isAutoSkipUltimate;
            Refresh();
        }

    }
}